package logic

import (
	"context"
	"merchantmanager/models/mysql"

	"merchantmanager/merchantrpc/internal/svc"
	"merchantmanager/merchantrpc/merchantrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type MerchantDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewMerchantDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MerchantDelLogic {
	return &MerchantDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *MerchantDelLogic) MerchantDel(in *merchantrpc.MerchantRequest) (*merchantrpc.MerchantResponse, error) {
	// todo: add your logic here and delete this line
	var mer mysql.Mer
	mysql.DB.Debug().Delete(&mer)
	return &merchantrpc.MerchantResponse{
		Id: int64(mer.ID),
	}, nil
}
